package com.ganbo.rabbitmq.basic.direct;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class DirectController {


    @Autowired
    RabbitTemplate rabbitTemplate;


    @GetMapping("/direct")
    public String direct() {
        rabbitTemplate.convertAndSend(DirectConfig.EXCHANGE_direct_direct, "aaa", System.currentTimeMillis() + "消息");
        return "success";
    }
}
